home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / samples / Multimedia / DirectPlay / AddressOverride / readme.txt < prev    next >
Text File  |  2001-10-10  |  4KB  |  93 lines

  1. //-----------------------------------------------------------------------------
  2. // 
  3. // Sample Name: AddressOverride Sample
  4. // 
  5. // Copyright (c) 1999-2001 Microsoft Corporation. All rights reserved.
  6. // 
  7. //-----------------------------------------------------------------------------
  8.  
  9.  
  10. Description
  11. ===========
  12.   AddressOverride shows how to programmatically tell DirectPlay the addressing 
  13.   in order to host or connect to another session on the network, instead of just 
  14.   letting DirectPlay popup a dialog box to ask the user the connection settings.  
  15.   Most games will typically follow this method so they can customize the UI.
  16.   
  17. Path
  18. ====
  19.   Source: DXSDK\Samples\Multimedia\DirectPlay\AddressOverride 
  20.  
  21.   Executable: DXSDK\Samples\Multimedia\DirectPlay\Bin
  22.  
  23. User's Guide
  24. ============
  25.   Enter the player's name, session, and check or uncheck the 'host sesion' 
  26.   checkbox.  
  27.   
  28.   Choose a service provider, and adapter.  If the TCP/IP SP is chosen, and 
  29.   hosting then enter port or it leave blank to have DirectPlay automatically 
  30.   pick a port.  If joining, then enter the port and the IP address of the host, 
  31.   or leave blank to search the subnet.  If the modem SP is chosen, then enter 
  32.   the phone number. If the IPX SP is chosen, then enter the port. If the 
  33.   serial SP is chosen, then the simple dialog will use the default DirectPlay 
  34.   dialog to query the user for the serial settings.
  35.   
  36.   Click OK to start or join a game.  Once in a session, it presents a 
  37.   simple game similiar to SimplePeer.  
  38.  
  39. Programming Notes
  40. =================
  41.   The AddressOverride sample is very similar in form to the SimplePeer sample.  For 
  42.   detailed programming notes on the basics this sample, refer to Programming 
  43.   Notes section of the SimplePeer sample.
  44.  
  45.   The AddressOverride differs by letting programmatically telling DirectPlay
  46.   the address instead of just letting DirectPlay popup a dialog box.  
  47.   
  48.   * The "OK" button is pressed.  See LaunchMultiplayerGame().
  49.         1. It gathers if the user wants to host or join.
  50.         2. It gathers the SP guid from the UI
  51.         3. If hosting it creates a IDirectPlay8Address* called pHostAddress and 
  52.            calls IDirectPlay8Address::SetSP() on it.
  53.         4. If joining or hosting it creates a IDirectPlay8Address* called 
  54.            pDeviceAddress and calls IDirectPlay8Address::SetSP() on it.
  55.         5. If gathers from the UI if an adapter was selected.  If it was it calls
  56.            IDirectPlay8Address::SetDevice() on the pDeviceAddress.
  57.         6. It then fills in the pDeviceAddress and the pHostAddress depending
  58.            on the SP selected, and if joining or hosting by calling
  59.            IDirectPlay8Address::AddComponent.  Here's how that works:
  60.            
  61.            - If the TCP/IP SP was selected and hosting, then:
  62.                 - If a port was entered it calls 
  63.                   IDirectPlay8Address::AddComponent( DPNA_KEY_PORT, ... )
  64.                   on the pDeviceAddress to add the port.
  65.           - If the TCP/IP SP was selected and joining, then:
  66.                 - If a IP address was entered it calls 
  67.                   IDirectPlay8Address::AddComponent( DPNA_KEY_HOSTNAME, ... )
  68.                   on the pHostAddress to add the IP address.
  69.                 - If a port was entered it calls 
  70.                   IDirectPlay8Address::AddComponent( DPNA_KEY_PORT, ... )
  71.                   on the pHostAddress to add the port.
  72.                   
  73.           - If the IPX SP was selected and hosting, then:
  74.                 - If a port was entered it calls 
  75.                   IDirectPlay8Address::AddComponent( DPNA_KEY_PORT, ... )
  76.                   on the pDeviceAddress to add the port.
  77.           - If the IPX SP was selected and joining, then:
  78.                 - If a port was entered it calls 
  79.                   IDirectPlay8Address::AddComponent( DPNA_KEY_PORT, ... )
  80.                   on the pHostAddress to add the port.
  81.                   
  82.           - If the modem SP was selected and joining, then:
  83.                 - If a phone number was entered it calls 
  84.                   IDirectPlay8Address::AddComponent( DPNA_KEY_PHONENUMBER, ... )
  85.                   on the pHostAddress to add the phone number.
  86.                   
  87.         7. It then connects in a similar manner as SimplePeer, but using 
  88.            the pDeviceAddress and pHostAddress it filled to connect or join
  89.            to the session.
  90.            
  91.   
  92.    
  93.